package com.example.module_service.device

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.lib_base.path.RouterPath
import com.example.lib_common.view.view.BaseMvvmActivity
import com.example.module_service.R
import com.example.module_service.databinding.ActivityPatorIdetailBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = RouterPath.PATH_POINT_DETAIL_PAGE)
class PatorIDetailActivity : BaseMvvmActivity<ActivityPatorIdetailBinding>() {
    override fun getLayoutId(): Int {
        return R.layout.activity_pator_idetail
    }

    override fun initViews() {
        super.initViews()

        // 获取通过 ARouter 传递的参数
        val pointId = intent.getStringExtra("pointId")
        val pointName = intent.getStringExtra("pointName")
        val projectName = intent.getStringExtra("projectName")
        val pointLocation = intent.getStringExtra("pointLocation")
        val patrolType = intent.getStringExtra("patrolType")
        val patrolStandard = intent.getStringExtra("patrolStandard")
        val status = intent.getStringExtra("status")

        // 可以将获取到的数据显示在 UI 上
        // 示例：mDataBinding.tvPointName.text = pointName

        // 设置返回按钮点击事件
        mDataBinding.ivBack.setOnClickListener {
            finish()
        }
        mDataBinding.PatroName.text=pointName
        mDataBinding.poingress.text=pointName
        mDataBinding.pointtype.text=patrolType
        mDataBinding.PointName.text=pointLocation
        //pointId转换为int
        val pointIdInt = pointId?.toInt()
        if (pointIdInt != null) {
            if(pointIdInt%2==0){
                mDataBinding.kai.text="未启用"
            }else{
                mDataBinding.kai.text="启用"
            }
        }

    }
}
